package gui;


import java.awt.Dimension;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JProgressBar;

/**
 * @author aioros
 * Frame which contains a JProgessBar
 */
public class ProgressBarFrame extends JFrame {

	
	/*-------------------- Fields -----------------------------*/
	
	private static final long serialVersionUID = 175678L;
	
	
	/**
	 * Progress Bar
	 */
	private JProgressBar progressBar;
	
	
	
	/*-------------------- Constructor ------------------------*/
	
	public ProgressBarFrame(){
		super();
		//super(CeroRepositoryClient.getCeroRepositoryClient(), "Wait during installing" , true);
		
		this.progressBar = new JProgressBar();
		this.progressBar.setBounds(20, 25, 250, 20);
		this.progressBar.setIndeterminate(true);
		
		this.getContentPane().setLayout(null);
		this.getContentPane().add(this.progressBar);
		
		this.initialize();
		
		this.pack();
		this.setVisible(true);
	}
	
	
	
	/*-------------------- Methodes ---------------------------*/
	
	/**
	 * property frame initialize 
	 */
	private void initialize() {
		
		this.setTitle("Wait during installing");
		this.setSize(300, 100);
		this.setPreferredSize(new Dimension(300, 100));
		this.setResizable(false);
		this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		Dimension tailleEcran = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
		this.setLocation(	(int) (tailleEcran.getWidth()- this.getWidth())/2,
				(int) (tailleEcran.getHeight()- this.getHeight())/2 );
		ImageIcon logosmall = new ImageIcon("ressources/images/logosmall.png");
		this.setIconImage(logosmall.getImage());
	}



	/**
	 * @return the JProgressBar
	 */
	public JProgressBar getProgressBar() {
		return progressBar;
	}



}
	
	

